/**
 * Created with JetBrains PhpStorm.
 * User: DELL
 * Date: 1/4/13
 * Time: 6:42 PM
 * To change this template use File | Settings | File Templates.
 */
/*
* Customer Util
* Components By AnhDT
* Email: anhdt118@gmail.com
* Mobile: 0942732200
* Released: 2012 - 2013
* */
if (typeof Customer == 'undefined') {
    var Customer = {};
}

// Add Product To Cart
Customer.getDistricts = function(city_id, selector_id) {
    var data = {"id": city_id};
    var tid = (new Date()).getTime();
    var container = $(selector_id);
    if ($(container).size() == 0) {
        console.log('Not Found District Seletor');
        return false;
    }
    $.ajax({
        url: BASE_URL + 'customer/address/ajax_get_districts?_tid=' + tid,
        type: "POST",
        data: data,
        success: function(data) {
            $(container).html($(data));
        }
    });
    return false;
};

Customer.toggleCheckedValue = function(object) {
    var checked = $(object).attr("checked");
    if (!checked) {
        $(object).val(0);
    } else {
        $(object).val(1);
    }
    return false;
}